/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.amitycs.collabdrawing.gui;

import java.awt.Shape;
import java.awt.geom.Line2D;
import org.amitycs.collabdrawing.Whiteboard;

/**
 *
 * @author mike
 */
public class LineTool extends Tool {

    public LineTool(Whiteboard wb)
    {
        super(wb);
    }

    public Line2D.Double line;
    @Override
    public Shape onDrag(double x2, double y2) {
        line = new Line2D.Double(line.x1, line.y1, x2, y2);
        return line;
    }

    @Override
    public Shape onPress(double x, double y) {
        line = new Line2D.Double(x, y, x, y);
        return line;
    }

    @Override
    public void onRelease(double x, double y) {
        fireShapeDone(line);
    }
    
}
